#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int fun(int num) {
    for (int i = 2; i * i <= num; i++) {
        if (num % i == 0)
            return 0;
    }
    return 1;
}

int main() {
    int N, M;
    scanf("%d%d", &N, &M);
    for (int i = M; i <= N; i++) {
        if (fun(i))
            printf("%d\n", i);
    }
    return 0;
}
